package com.teach;

/**
 * <pre>
 * -
 * Author : J.L.Zhou
 * E-Mail : 2233875735@qq.com
 * Tel : 151 1104 7708
 * Date : 2021-04-01 16:12
 * Version : 1.0
 * Copyright 2021 jlzhou.top Inc. All rights reserved.
 * Warning: this content is only for internal circulation of the company.
 *          It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 **/
public class Singleton {

//  private static Singleton instance = new Singleton();//饿汉单例

  private static Singleton instance;

  private Singleton(){}

  public  static Singleton getInstance(){
    if(instance==null){//懒汉模式
      instance = new Singleton();
    }
    return instance;
  }
}
